#include <stdio.h>
#include <stdlib.h>
typedef struct node{
    int data;
    struct node* next;
}node ;
int main(int data[], int n){
    struct node* header;
    struct node* cur = NULL;
    if(data == NULL || n<=0){
        printf("error");
        return NULL;
    }
    for(int i = 0; i < n; i++){
        struct node* newnode = (struct node*) malloc(sizeof(struct node));
        if(newnode == NULL){
            printf("error");
            return NULL;

        }
        newnode->data = data[i];
        newnode->next = NULL;
        if(!i){
            header = (struct node*) malloc(sizeof(struct node));
            if(header == NULL){
                printf("error");
                return NULL;

            }
            cur = header->next =newnode;
        }
        if(i){
            cur->next = newnode;
            cur = newnode;
        }
    }
    return (size_t)header;
}